package com.ruoyi.service.impl;
import com.ruoyi.domain.CategoryBrand;
import com.ruoyi.domain.GoodsSpuInfo;
import com.ruoyi.mapper.CategoryBrandMapper;
import com.ruoyi.mapper.GoodsSpuInfoMapper;
import com.ruoyi.service.IGoodsSpuInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsSpuInfoServiceImpl implements IGoodsSpuInfoService {
    @Autowired
    GoodsSpuInfoMapper goodsSpuInfoMapper;

    @Override
    public List<GoodsSpuInfo> list() {
        return goodsSpuInfoMapper.selectList();

    }

    @Override
    public List<GoodsSpuInfo> listForPage(GoodsSpuInfo goodsSpuInfo) {
        return goodsSpuInfoMapper.selectListForPage(goodsSpuInfo);
    }

    @Override
    public GoodsSpuInfo getById(Long id) {
        return goodsSpuInfoMapper.selectByPrimaryKey(id);
    }

    @Override
    public int save(GoodsSpuInfo goodsSpuInfo) {
        return goodsSpuInfoMapper.insertSelective(goodsSpuInfo);
    }

    @Override
    public int updateById(GoodsSpuInfo goodsSpuInfo) {
        return goodsSpuInfoMapper.updateByPrimaryKeySelective(goodsSpuInfo);
    }

    @Override
    public int removeByIds(Long[] ids) {
        return goodsSpuInfoMapper.deleteByPrimaryKeys(ids);
    }
}
